<table class="table" width="100%" border="0">
    <thead>
        <tr>
            <th>阶段</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>中心投入</th>
            <th>公司投入</th>
            <th>中心设计</th>
            <th>公司设计</th>
            <th>中心加班</th>
            <th>公司加班</th>
            <th>中心节日</th>
            <th>公司节日</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    {{x = [0]*8
    from uliweb.orm import get_model
    Plan = get_model('plan')}}
    {{for obj in objects:}}
        <tr>
            {{plan = Plan.get(obj.plan)}}
            <th>{{=(plan and plan.title) or obj.get_display_value('stage')}}</th>
            <td>{{=obj.field_str(obj.begin_time)}}</td>
            <td>{{=obj.field_str(obj.end_time)}}</td>
            <td>{{=obj.amount_inner_input}}{{x[0]+=obj.amount_inner_input}}</td>
            <td>{{=obj.amount_outer_input}}{{x[1]+=obj.amount_outer_input}}</td>
            <td>{{=obj.amount_inner_design}}{{x[2]+=obj.amount_inner_design}}</td>
            <td>{{=obj.amount_outer_design}}{{x[3]+=obj.amount_outer_design}}</td>
            <td>{{=obj.amount_inner_out8}}{{x[4]+=obj.amount_inner_out8}}</td>
            <td>{{=obj.amount_outer_out8}}{{x[5]+=obj.amount_outer_out8}}</td>
            <td>{{=obj.amount_inner_weekend}}{{x[6]+=obj.amount_inner_weekend}}</td>
            <td>{{=obj.amount_outer_weekend}}{{x[7]+=obj.amount_outer_weekend}}</td>
            <td>{{=obj.memo}}</td>
            <td>{{if request.user.is_superuser or (request.user.is_gm and request.user._kfzx_ == obj._kfzx_):}}
            <a href="/tasks/details/{{=obj.id}}/delete" onclick="return confirm('确定要删除当前记录吗？');">删除</a>
            {{pass}}
            {{if can_modified and check_timeout(obj):}}
            <a href="/tasks/details/{{=obj.id}}/edit">修改</a>
            {{pass}}
            </td>
        </tr>
    {{pass}}
    <tr class="sum">
        <th>合计</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>{{=x[0]}}</td>
        <td>{{=x[1]}}</td>
        <td>{{=x[2]}}</td>
        <td>{{=x[3]}}</td>
        <td>{{=x[4]}}</td>
        <td>{{=x[5]}}</td>
        <td>{{=x[6]}}</td>
        <td>{{=x[7]}}</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    </tbody>
</ul>